﻿#region

using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogicLayer;
using BusinessObjects;

#endregion

namespace FastTrackCabService.AdminPanel
{
    public partial class Profile : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var staffId = Convert.ToInt32(User.Identity.Name);
                var staff = StaffBLL.GetStaffById(staffId);
                var admin = AdministratorBLL.GetAdministrator(staffId);
                var administrator = new Administrator(admin, staff);
                DetailsView1.DataSource = new List<Administrator> {administrator};
                DetailsView1.DataBind();
            }
        }

        protected void DetailsView1_OnModeChanging(object sender, DetailsViewModeEventArgs e)
        {
            Response.Redirect("EditProfile.aspx");
        }
    }
}